package com.big.app.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.big.app.dao.ShowCanDao;
import com.big.app.entity.ShouCan;
import com.big.app.service.intf.ShouCanService;

import com.big.app.vo1.R;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class ShouCanImpl implements ShouCanService {
    @Resource
    private ShowCanDao dao;
    @Override
    public R all() {
        return new R(200,"ok",dao.selectList(new QueryWrapper<ShouCan>().eq("scusers","123")));
    }

    @Override
    public R insert(ShouCan shouCan) {
        shouCan.setScusers("123");
        return new R(200,"ok",dao.insert(shouCan));
    }

    @Override
    public R delete(ShouCan shouCan) {
        int i = dao.deleteById(shouCan);

        if (i==1){
            return new R(200,"ok",null);
        }else {
            return new R(400,"false",null);
        }
    }
}
